<template>
  <div class="notice-box">
    <mallki class-name="mallki-text" text="系统更新公告" />
    <div class="notice-container">
      <el-timeline>
        <el-timeline-item
          v-for="(n, index) in dataList"
          :key="index"
          type="primary"
          :timestamp="n.pubDate">
          {{ n.content }}
        </el-timeline-item>
      </el-timeline>
    </div>
  </div>
</template>

<script>
  import Mallki from '@/components/TextHoverEffect/Mallki'
  import { CODE_OK } from '@/common/js/config'
  import { getNoticeList } from '@/api/notice'
  export default {
    components: { Mallki },
    data() {
      return {
        dataList: []
      }
    },
    created() {
      this.getInfo()
    },
    methods: {
      getInfo() {
        getNoticeList().then(res => {
          if (res.code === CODE_OK) {

            this.dataList = res.list
          }else{
            this.$message.error(res.msg)
          }
        })
      }
    }
  }
</script>

<style scoped>
  .notice-box{
    width: 100%;
    padding-top: 20px;
    background-color: #FFF;
  }
  .notice-container{
    padding-top: 15px;
    height: 515px;
    width: 100%;
    background-color: #FFF;
  }
  .mallki-text {
    left: 25px;
    font-size: 20px;
    font-weight: bold;
  }
</style>
